/*
 * <one line to give the program's name and a brief idea of what it does.>
 * Copyright (C) 2019
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef SHIP_H
#define SHIP_H

#include "commondata.hpp"

/**
 * \class Ship
 * Basic class for ship
 */
class Ship {
public:
	Ship() {}
	Ship(const Ship & other) = delete;
	virtual ~Ship() {}

	/**
	 * Update ship params
	 */
	virtual void reset() = 0;

	/**
	 * \return attack speed
	 */
	virtual uint32_t getSpeed() const = 0;

	/**
	 * \return ship hp
	 */
	virtual double getHP() const = 0;

	/**
	 * \return ship shield
	 */
	virtual double getShield() const = 0;

	/**
	 * \return ship damage
	 */
	virtual double getDamage() const = 0;

	/**
	 * Shield not only block damage, but also absorp.
	 * More high shield level can absorp more damage per 1 shield point
	 * \return shield absorption. How much damage will be absorpted by 1 shield point
	 */
	virtual double getShieldAbsorption() const = 0;

	/**
	 * Ship speed converted to battle timer. This is time between attacks.
	 * More speed => less timer
	 * \return battle timer
	 */
	uint64_t getBattleTimer() const {
		return m_BattleTimer;
	}

	/**
	 * Set new battle timer
	 * \param[in] timer new battle timer
	 */
	void setBattleTimer(const uint64_t timer) {
		m_BattleTimer = timer;
	}

	/**
	 * This struct using for battle calculations
	 */
	ShipData m_Data;

protected:
	uint64_t m_BattleTimer = 0;
};

#endif // SHIP_H
